<?php
/**
 * @var $schoolsList
 * @var $provinceList
 * @var $weekHotSchool
 * @var $jobCate
 * @var $hotWeekJobCate
 */
$currentCityName = $this->request->getParam('cityName',false);
$currentProvinceName = $this->request->getParam('provinceName',false);
?>
<div class="mainJobs mainWith">
    <div class="schoolHeader clearFix">
        <div class="schoolLocation">
            关键词：<span style="color: #ff4466"><?php echo $this->request->getParam('searchWord')?></span> - 教育机构搜索结果
        </div>
    </div>
    <div class="clearFix">
        <div class="schoolContentWrap clearFix">
            <div class="latestSchool">
                <div class="latestSchoolLabel">
                    最新学校
                </div>
                <div class="latestSchoolList">
                    <?php foreach ($schoolsList as $item){
                        ?>
                        <div class="latestSchoolDetail">
                            <div class="latestSchoolDetailTop clearFix">
                                <div class="latestSchoolName">
                                    <a href="/school/<?php echo $item->id?>.html"><?php echo $item->title?></a>
                                </div>
                                <div class="latestSchoolLocationAndNature">
                                    <div class="latestSchoolLocation">
                                        地区：<span><?php echo $item->location?></span>
                                    </div>
                                    <div class="latestSchoolNature">
                                        性质：<span><?php echo $item->type?></span>
                                    </div>
                                </div>
                            </div>
                            <div class="latestSchoolDetailBottom clearFix">
                                <p class="employeeIntro zp_search_detail">正在招聘<span class="employeeNum"><?php echo count($item->jobs)?></span>个职位：</p>
                                <div class="employeePosition">
                                    <?php foreach ($item->jobs as $job) {
                                        ?>
                                        <a href="/jobs/<?php echo $jobCate[$item->id][$job->id]->name_py?>/<?php echo $job->id?>.html" title="<?php echo $job->name?>">
                                            <?php echo $job->name?>
                                        </a>
                                        <?php
                                    }?>
                                </div>
                            </div>
                        </div>
                        <?php
                    }?>
                    <?php if($schoolsList->count() === 0){
                        ?>
                        <p style="font-size: 18px;text-align: center;margin: 30px 0 0 0;">暂无数据</p>
                        <?php
                    }?>
                </div>
                <div class="page-wrapper">
                    <!--分页代码-->
                    <?php
                        echo $this->element('paginator', [  "url" => '/'.$this->request->url.'_' ]);
                    ?>
                </div>
            </div>
            <div class="weekHotSchool">
                <div class="latestSchoolLabel">
                    本周热门学校
                </div>
                <div class="weekHotSchoolList">
                    <?php foreach ($weekHotSchool as $key=>$item){
                        if ($key <= 2) {
                            ?>
                            <div class="weekHotSchoolDetail">
                                <div class="weekHotSchoolTopRank">
                                    <?php echo $key+1?>
                                </div>
                                <div class="weekHotSchoolName">
                                    <a href="/school/<?php echo $item->id?>.html"><?php echo $item->title?></a>
                                </div>
                                <div class="weekHotSchoolEmployee">
                                    招聘<span class="weekHotEmployeeNum"><?php echo count($item->jobs)?></span>
                                    个职位：
                                    <?php if (count($item->jobs)>0){
                                        ?>
                                        <a href="/jobs/<?php echo $hotWeekJobCate[$item->id][$item->jobs[0]->id]->name_py?>/<?php echo $item->jobs[0]->id?>.html">
                                            <span class="weekHotSchoolPosition"><?php echo $item->jobs[0]->name?></span>
                                        </a>等
                                        <?php
                                    } else {
                                        ?>
                                        暂无工作岗位
                                        <?php
                                    }?>
                                </div>
                            </div>
                        <?php }
                    }?>
                </div>
            </div>
        </div>
    </div>
</div>